package com.itheima.controller;

import com.itheima.domain.ClassQueryParam;
import com.itheima.domain.Result;
import com.itheima.domain.pojo.ClazzSize;
import com.itheima.domain.pojo.JobOption;
import com.itheima.service.ReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RequestMapping("/report")
@RestController
public class ReportController {
    @Autowired
    private ReportService reportService;

    /**
     * 员工职位人数统计
     * @return
     */
    @GetMapping ("/empJobData")
    public Result getEmpJobData(){
        JobOption jobOption = reportService.getEmpJobData();
        return Result.success(jobOption);
    }

    /**
     * 员工性别人数统计
     * @return
     */
    @GetMapping("/empGenderData")
    private Result getEmpGenderData(){
        List<Map> list =reportService.getEmpGenderData();
        return Result.success(list);
    }

    /**
     * 学生学历信息统计
     */
    @GetMapping("/studentDegreeData")
    public Result getStudentDegreeData(){
        List<Map> list =reportService.getStudentDegreeData();
        return Result.success(list);
    }
    /**
     * 班级人数统计
     */
    @GetMapping("/studentCountData")
    public Result getStudentCountData(){
        ClazzSize clazzSize =reportService.getStudentCountData();
        return Result.success(clazzSize);
    }



}
